From 3fcbbc1cfe901a86b8e70d77da9030ac0ec0768f Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 7 Feb 2006 13:57:40 +0000 Subject: [PATCH] Fix x86_64 SMP support. Signed-off-by: Christian Limpach --- linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c | 3 +++ .../arch/x86_64/kernel/setup64-xen.c | 2 ++ linux-2.6-xen-sparse/drivers/xen/core/smpboot.c | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c index eaa32d8206..37f63dab70 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c @@ -911,6 +911,9 @@ void __init setup_arch(char **cmdline_p) init_apic_mappings(); #endif #endif +#if defined(CONFIG_XEN) && defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU) + prefill_possible_map(); +#endif #if defined(CONFIG_XEN_PRIVILEGED_GUEST) || !defined(CONFIG_XEN) /* diff --git a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c index a76d646590..a1bcc022b4 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c @@ -272,8 +272,10 @@ void __cpuinit cpu_init (void) * Initialize the per-CPU GDT with the boot GDT, * and set up the GDT descriptor: */ +#ifndef CONFIG_XEN if (cpu) memcpy(cpu_gdt(cpu), cpu_gdt_table, GDT_SIZE); +#endif cpu_gdt_descr[cpu].size = GDT_SIZE; #ifndef CONFIG_XEN diff --git a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c index 5a38f6b1f6..91f507299b 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c @@ -81,6 +81,18 @@ EXPORT_SYMBOL(x86_cpu_to_apicid); unsigned int maxcpus = NR_CPUS; #endif +void __init prefill_possible_map(void) +{ + int i, rc; + + for (i = 0; i < NR_CPUS; i++) { + rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); + if (rc == -ENOENT) + break; + cpu_set(i, cpu_possible_map); + } +} + void __init smp_alloc_memory(void) { } -- 2.30.2